/*
 * GuudSurface.h
 *
 *  Created on: 2013-1-19
 *      Author: heqiu
 */

#ifndef GUUDSURFACE_H_
#define GUUDSURFACE_H_
#include <stdio.h>
#include <string>
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"

namespace guud {
class GuudSurface {
public:
	SDL_Surface* m_pSDL_Surface;
	uint32_t m_uiBeginX;
	uint32_t m_uiBeginY;
	uint32_t m_uiXpixel;
	uint32_t m_uiYpixel;
	uint32_t m_uiXnum;
	uint32_t m_uiYnum;

	GuudSurface();
	~GuudSurface();
	//加载显示图像
	bool loadImage(const char * pName);
	//初始化图片切块 (左上起点位置，块大小，块个数）
	void init(uint32_t uiBeginX, uint32_t uiBeginY, uint32_t uiXpixel,
			uint32_t uiYpixel, uint32_t uiXnum, uint32_t uiYnum);
	bool getRGB(uint32_t uiXpixel, uint32_t uiYpixel, uint32_t & color);
	//打印像素点值
	void printOut();
	//判断点是否在内
	bool bPointIn(int32_t iXPosPixel, int32_t iYPosPixel);
private:
	GuudSurface(const GuudSurface & obj);
};
}

#endif /* GUUDSURFACE_H_ */
